EIGEN_INCDIR := -I/home/zhangyi/eigen/
OPENBLAS_INCDIR := -I/opt/OpenBLAS/include/
OPENBLAS_LIBDIR := /opt/OpenBLAS/lib/
OPENBLAS_LIB := -L$(OPENBLAS_LIBDIR) -l:libopenblas.a -pthread -fopenmp
CCFLAG := -O2 -std=c++14
TARGETS := bench.bin
OBJECTS := main.o
CC := g++

INC = $(OPENBLAS_INCDIR)
INC += $(EIGEN_INCDIR)
LIB = $(OPENBLAS_LIB)


$(TARGETS) : $(OBJECTS)
	$(CC) -o $@ $< $(LIB)

imax.goto : imax.o
	$(CC) -o $@ $< $(LIB)

main.o : main.cpp
	$(CC) -c $< $(CCFLAG) $(INC)

imax.o : imax.cpp
	$(CC) -c $< $(CCFLAG) -DDOUBLE $(INC)

.PHONY : clean
clean :
	-rm $(TARGETS) $(OBJECTS) imax.o imax.goto
